ci(release): fail the PSGallery check on a query error instead of assuming not-published#34
Conversation
…uming not-published Now that Publish is gated only on this check (recovery-gap fix #33), a Find-Module -ErrorAction SilentlyContinue returning $null was treated as 'not on gallery' for BOTH a genuine miss and a transient query failure — so a network/PSGallery hiccup could trigger a blind publish attempt. Capture -ErrorVariable: publish only on a clean miss (Find-Module records no error for a genuine not-found, verified for new-version and never-published cases); on a recorded error, throw so the run is visibly retryable. Surfaced by CodeRabbit/Copilot during the YouTubeMusicPS rollout review. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe publish workflow's PowerShell Gallery version check now distinguishes query failures from missing versions. The step captures Find-Module errors via ChangesPSGallery Version Check Error Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR tightens the PowerShell Gallery “already published?” gate in the release workflow so that transient Find-Module query failures no longer get misinterpreted as “not published,” preventing accidental blind publish attempts when PSGallery/network hiccups occur.
Changes:
- Capture
Find-Modulefailures via-ErrorVariablewhile still suppressing output with-ErrorAction SilentlyContinue. - Fail the workflow explicitly (
throw) when the PSGallery query errors, while continuing to treat a clean miss as “not published”.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Follow-up to the recovery-gap fix (#33). Now that
Publishis gated only on the PSGallery check, that check's error handling matters:Find-Module -ErrorAction SilentlyContinuereturns$nullfor both a genuine "not on gallery" and a transient query failure — so a network/PSGallery hiccup would be read as "not published" and trigger a blind publish attempt.Fix: capture
-ErrorVariable. A genuine not-found records no error (verified for an existing-module/new-version and a never-published module), so we publish only on a clean miss; a recorded error means the query itself failed →throwso the run is visibly retryable.Surfaced by CodeRabbit + Copilot during the YouTubeMusicPS rollout review. Workflow YAML parses; no manifest change.
🤖 Generated with Claude Code
Summary by CodeRabbit